<template>
  <vue-office-pdf
    :src="fileUrl"
    style="height: 100%"
    @error="errorHandler"
    @rendered="renderedHandler"
  />
</template>

<script>
import VueOfficePdf from '@vue-office/pdf';

export default {
  name: 'PdfPreview',
  components: {
    VueOfficePdf
  },
  props: {
    fileUrl: {
      type: String
    }
  },
  methods: {
    errorHandler(error) {
      this.$emit('error', error);
    },
    renderedHandler() {
      this.$emit('success');
    }
  }
};
</script>

<style></style>
